package com.conghuhu.controller;

import com.conghuhu.Result;
import com.conghuhu.api.TestService;
import com.conghuhu.entity.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author conghuhu
 * @create 2021-09-24 19:23
 */
@RestController
@Api(tags = "测试模块")
public class TestController {
    @Autowired
    private TestService testService;

    @GetMapping("/test")
    @ApiOperation("测试接口")
    public Result test() {

        User user = testService.getUserById(2);
        if(user != null){
            return Result.success(user);
        }else{
            return Result.fail("500","查询无果");
        }

    }
}
